<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/12/22
  Time: 20:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>进货记录查询</title>

    <link href="/statics/css/bootstrap.css" rel="stylesheet"/>
    <link href="/statics/font/bootstrap-icons.css" rel="stylesheet" >

</head>
<body>
<%@include file="inc/nav.jsp"%>

<div class="container-fluid">
    <div class="row p-3 mt-3">
        <div class="col-3 col-lg-2">
            <%@include file="inc/menu.jsp"%>
        </div>
        <div class="col-9 col-lg-10">
            <div class="d-flex">
                <div class="input-group">
                    <form class="form-inline" action="/restock/list" method="post">
                        <input type="text" name="goodsName" class="form-control mr-1" placeholder="请输入商品">
                        <input type="text" name="supplierName" class="form-control mr-1" placeholder="请输入供应商">
                        <label class="mr-1">从</label>
                        <input type="date" name="startDate" class="form-control mr-1" />
                        <label class="mr-1">到</label>
                        <input type="date" name="endDate" class="form-control mr-1" />

                        <button type="submit" class="btn btn-success"><i class="bi-search"></i>查询</button>
                    </form>
                </div>

            </div>
            <div class="row mt-3">
                <div class="col-12">
                    <table class="table table-hover table-bordered table-striped text-center">
                        <thead class="thead-dark">
                        <tr>
                            <th >序号</th>
                            <th >商品名</th>
                            <th >供应商</th>
                            <th >进货日期</th>
                            <th >进价</th>
                            <th >数量</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${requestScope.restockList}" var="r" varStatus="vs">
                            <tr>
                                <td>${vs.count}</td>
                                <td>${r.goodsName}</td>
                                <td>${r.supplier}</td>
                                <td>${r.tradeDate}</td>

                                <td>${r.price}</td>
                                <td>${r.stock}</td>

                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <nav>
                        <ul class="pagination justify-content-between">
                            <li class="page-item">
                                <a class="page-link rounded-pill" href="/restock/list?currentPage=${requestScope.pager.previous}&goodsName=${param.goodsName}&supplierName=${param.supplierName}&startDate=${param.startDate}&endDate=${param.endDate}" tabindex="-1">上一页</a>
                            </li>
                            <li class="page-item"><a class="page-link rounded-pill">总共${requestScope.pager.pageCount}页，当前第${requestScope.pager.currentPage}页</a></li>
                            <li class="page-item">
                                <a class="page-link rounded-pill"href="/restock/list?currentPage=${requestScope.pager.next}&goodsName=${param.goodsName}&supplierName=${param.supplierName}&startDate=${param.startDate}&endDate=${param.endDate}">下一页</a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>

<footer class="fixed-bottom bg-dark text-white">
    <p class="text-center p-3 m-0">
        超市管理系统
    </p>
</footer>
<script src="/statics/js/jquery.js" type="text/javascript"></script>
<script src="/statics/js/bootstrap.js" type="text/javascript"></script>

</body>
</html>
